<?php
namespace app\index\controller;

class Index extends Common
{
    public function index()
    {   
        $ad=$this->getBanner();
        $artRes=$this->getPor();
        $this->assign([
            'ad'=>$ad,
            'artRes'=>$artRes,
        ]);
        return $this->fetch($this->temp.'/index.html');
    }
    //获取广告
    public function getBanner(){
        $ad=db('ad')->where('type',1)->select();
        return $ad;
    }
    //产品中心
    public function getPor(){
     
       $art=db('archives')->where('cid','in','(29,30,31)')->limit(10)->select();
       return $art;
    }

   
}
